CREATE TABLE [dbo].[TTIDEN_OPER]
(
[CO_EMPR] [dbo].[TD_VC_002] NOT NULL,
[NU_CNTB_EMPR] [dbo].[TD_IN_001_CONT] NOT NULL,
[ID_OPRC] [dbo].[TD_VC_003] NOT NULL,
[CO_OPRC_CNTB] [dbo].[TD_VC_003] NOT NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NOT NULL,
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTIDEN_OP__FE_US__558AAF1E] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NOT NULL,
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NOT NULL CONSTRAINT [DF__TTIDEN_OP__FE_US__567ED357] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTIDEN_OPER] ADD CONSTRAINT [CK__TTIDEN_OP__NU_CN__54968AE5] CHECK (([NU_CNTB_EMPR]>=(1) AND [NU_CNTB_EMPR]<=(99)))
GO
ALTER TABLE [dbo].[TTIDEN_OPER] ADD CONSTRAINT [TTIDEN_OPE_591472561] PRIMARY KEY CLUSTERED  ([CO_EMPR], [NU_CNTB_EMPR], [ID_OPRC], [CO_OPRC_CNTB]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TTIDEN_OPER] ADD CONSTRAINT [FK1_TMOPRC_CNTB_A_TTIDEN_OPER] FOREIGN KEY ([CO_EMPR], [CO_OPRC_CNTB]) REFERENCES [dbo].[TMOPRC_CNTB] ([CO_EMPR], [CO_OPRC_CNTB])
GO
ALTER TABLE [dbo].[TTIDEN_OPER] ADD CONSTRAINT [FK1_TTCNTB_EMPR_A_TTIDEN_OPER] FOREIGN KEY ([CO_EMPR], [NU_CNTB_EMPR]) REFERENCES [dbo].[TTCNTB_EMPR] ([CO_EMPR], [NU_CNTB_EMPR])
GO
